home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / i-cpoerr.ads < prev    next >
Text File  |  1996-01-30  |  5KB  |  90 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                 GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS               --
  4. --                                                                          --
  5. --              I N T E R F A C E S . C . P O S I X _ E R R O R             --
  6. --                                                                          --
  7. --                                  S p e c                                 --
  8. --                                                                          --
  9. --                             $Revision: 1.3 $                             --
  10. --                                                                          --
  11. --       Copyright (c) 1991,1992,1993,1994, FSU, All Rights Reserved        --
  12. --                                                                          --
  13. -- GNARL is free software; you can redistribute it  and/or modify it  under --
  14. -- terms  of  the  GNU  Library General Public License  as published by the --
  15. -- Free Software  Foundation;  either version 2, or (at  your  option)  any --
  16. -- later  version.  GNARL is distributed  in the hope that  it will be use- --
  17. -- ful, but but WITHOUT ANY WARRANTY;  without even the implied warranty of --
  18. -- MERCHANTABILITY  or  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Gen- --
  19. -- eral Library Public License  for more details.  You should have received --
  20. -- a  copy of the GNU Library General Public License along with GNARL;  see --
  21. -- file COPYING.LIB.  If not,  write to the  Free Software Foundation,  675 --
  22. -- Mass Ave, Cambridge, MA 02139, USA.                                      --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  This package contains those parts of the package POSIX defined in P1003.5
  27. --  (Ada binding to POSIX.1) needed to interface to Pthreads.
  28.  
  29. with Interfaces.C.POSIX_Constants;
  30. --  Used for, various constants
  31.  
  32. package Interfaces.C.POSIX_Error is
  33.  
  34.    type Return_Code is new int;
  35.  
  36.    Failure : constant Return_Code := -1;
  37.  
  38.    type Error_Code is new int;
  39.  
  40.    subtype EC is Error_Code;
  41.    --  Synonym used only in this package
  42.  
  43.    function Get_Error_Code return Error_Code;
  44.    pragma Import (C, Get_Error_Code, "get_errno");
  45.    --  An interface to the error number of the current thread.  This is updated
  46.    --  by Pthreads at each context switch.
  47.  
  48.    POSIX_Error : exception;
  49.  
  50.    --  Error number definitions.  These definitions are derived from
  51.    --  /usr/include/errno.h and /usr/include/sys/errno.h. These are SunOS
  52.    --  errors; they have not yet been checked fsor POSIX complience.
  53.  
  54.    --  Error number definitions.
  55.  
  56.    Operation_Not_Permitted            : constant EC := POSIX_Constants.EPERM;
  57.    No_Such_File_Or_Directory          : constant EC := POSIX_Constants.ENOENT;
  58.    No_Such_Process                    : constant EC := POSIX_Constants.ESRCH;
  59.    Interrupted_Operation              : constant EC := POSIX_Constants.EINTR;
  60.    Input_Output_Error                 : constant EC := POSIX_Constants.EIO;
  61.    No_Such_Device_Or_Address          : constant EC := POSIX_Constants.ENXIO;
  62.    Argument_List_Too_Long             : constant EC := POSIX_Constants.E2BIG;
  63.    Exec_Format_Error                  : constant EC := POSIX_Constants.ENOEXEC;
  64.    Bad_File_Descriptor                : constant EC := POSIX_Constants.EBADF;
  65.    No_Child_Process                   : constant EC := POSIX_Constants.ECHILD;
  66.    Resource_Temporarily_Unavailable   : constant EC := POSIX_Constants.EAGAIN;
  67.    Not_Enough_Space                   : constant EC := POSIX_Constants.ENOMEM;
  68.    Permission_Denied                  : constant EC := POSIX_Constants.EACCES;
  69.    Resource_Busy                      : constant EC := POSIX_Constants.EFAULT;
  70.    File_Exists                        : constant EC := POSIX_Constants.ENOTBLK;
  71.    Improper_Link                      : constant EC := POSIX_Constants.EBUSY;
  72.    No_Such_Operation_On_Device        : constant EC := POSIX_Constants.EEXIST;
  73.    Not_A_Directory                    : constant EC := POSIX_Constants.EXDEV;
  74.    Is_A_Directory                     : constant EC := POSIX_Constants.ENODEV;
  75.    Invalid_Argument                   : constant EC := POSIX_Constants.ENOTDIR;
  76.    Too_Many_Open_Files_In_System      : constant EC := POSIX_Constants.EISDIR;
  77.    Too_Many_Open_Files                : constant EC := POSIX_Constants.EINVAL;
  78.    Priority_Ceiling_Violation         : constant EC := POSIX_Constants.EINVAL;
  79.    Inappropriate_IO_Control_Operation : constant EC := POSIX_Constants.ENFILE;
  80.    File_Too_Large                     : constant EC := POSIX_Constants.EMFILE;
  81.    No_Space_Left_On_Device            : constant EC := POSIX_Constants.ENOTTY;
  82.    Invalid_Seek                       : constant EC := POSIX_Constants.ETXTBSY;
  83.    Read_Only_File_System              : constant EC := POSIX_Constants.EFBIG;
  84.    Too_Many_Links                     : constant EC := POSIX_Constants.ENOSPC;
  85.    Broken_Pipe                        : constant EC := POSIX_Constants.ESPIPE;
  86.    Operation_Not_Implemented          : constant EC := POSIX_Constants.ENOSYS;
  87.    Operation_Not_Supported            : constant EC := POSIX_Constants.ENOTSUP;
  88.  
  89. end Interfaces.C.POSIX_Error;
  90.